﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ServiceModel;
using SyncLib.Data;
using SyncLib;
using Microsoft.Synchronization;
using System.Data;
using System.Data.SqlClient;

namespace SyncLib.Interface
{
    [ServiceContract]
    [ServiceKnownType(typeof(ScopeInfoEx))]
    [ServiceKnownType(typeof(SqlException))]
    [ServiceKnownType(typeof(KDataBatch))]
    public interface ISyncManager : IRelationalSyncContract
    {
        [OperationContract]
        [FaultContract(typeof(WebSyncFaultException))]
        void Initialize(ScopeInfoEx scope, SyncProviderPosition position);

        [OperationContract]
        [FaultContract(typeof(WebSyncFaultException))]
        [FaultContract(typeof(DataFaultException))]
        string[] DownloadDependencyData2(DataTable master, ScopeInfoEx info);
        [OperationContract]
        [FaultContract(typeof(WebSyncFaultException))]
        void UploadDependencyData(KDataBatch batch);
       // void UploadDependencyData(string fileName, string remotePeerId, byte[] batchContents);

        [OperationContract]
        [FaultContract(typeof(WebSyncFaultException))]
        KDataBatch DownloadDependencyData(string fileName);

        [OperationContract]
        [FaultContract(typeof(WebSyncFaultException))]
        bool WaitOne(Guid clientId, int timeout);
        [OperationContract]
        [FaultContract(typeof(WebSyncFaultException))]
        void Release(Guid clientId);
        [OperationContract]
        [FaultContract(typeof(WebSyncFaultException))]
        void ClearSession();
        [OperationContract]
        [FaultContract(typeof(WebSyncFaultException))]
        bool Authentication(Guid clientId, Byte[] securityToken, string userName, string password);

        [OperationContract]
        [FaultContract(typeof(WebSyncFaultException))]
        KSyncStatistics GetSyncStatistics();

        [OperationContract]
        [FaultContract(typeof(WebSyncFaultException))]
        void KeepAlive();
        [OperationContract]
        [FaultContract(typeof(WebSyncFaultException))]
        DataSet GetClientList();
        [OperationContract]
        [FaultContract(typeof(WebSyncFaultException))]
        void UpdateSyncTimes(Guid clientId,ScopeInfoEx scope);
    }

}
